

<title>后台管理员</title>
  
<div class="layui-card layadmin-header">
  <div class="layui-breadcrumb" lay-filter="breadcrumb">
    <a lay-href="">主页</a>
    <a><cite>用户</cite></a>
    <a><cite>后台管理员</cite></a>
  </div>
</div>

<div class="layui-fluid">   
  <div class="layui-card">
    <div class="layui-form layui-card-header layuiadmin-card-header-auto" lay-filter="layadmin-useradmin-formlist">
      <div class="layui-form-item">
        <div class="layui-inline">
          <label class="layui-form-label">登录名</label>
          <div class="layui-input-block">
            <input type="text" name="username" placeholder="请输入" autocomplete="off" class="layui-input">
          </div>
        </div>
        <div class="layui-inline">
          <label class="layui-form-label">手机</label>
          <div class="layui-input-block">
            <input type="text" name="telphone" placeholder="请输入" autocomplete="off" class="layui-input">
          </div>
        </div>
        <div class="layui-inline">
          <label class="layui-form-label">邮箱</label>
          <div class="layui-input-block">
            <input type="text" name="email" placeholder="请输入" autocomplete="off" class="layui-input">
          </div>
        </div>
        <div class="layui-inline">
          <label class="layui-form-label">角色</label>
          <div class="layui-input-block">
            <script type="text/html" template lay-url="/index/role/role_list" lay-done="layui.data.done(d);">
              <select name="role" >
                <option value="" >请选择</option>
                {{#  layui.each(d.data, function(index, item){ }}
                  <option value="{{ item.id }}">{{ item.title }}</option>
                {{#  }); }}
              </select>
            </script>
          </div>
        </div>
        <div class="layui-inline">
          <button class="layui-btn layuiadmin-btn-admin" lay-submit lay-filter="admin_user_list_search">
            <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
          </button>
        </div>
      </div>
    </div>
    
    <div class="layui-card-body">
      <div style="padding-bottom: 10px;">
        <button class="layui-btn layuiadmin-btn-admin" data-type="add">添加</button>
      </div>

      <table id="admin_user_list" lay-filter="admin_user_list"></table>  
      <script type="text/html" id="buttonTpl">
        {{#  if(d.status == 1){ }}
          <button class="layui-btn layui-btn-xs">正常</button>
        {{#  } else { }}
          <button class="layui-btn layui-btn-primary layui-btn-xs">关闭</button>
        {{#  } }}
      </script>
      <script type="text/html" id="table-useradmin-admin">
        <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a>
        {{#  if(d.role == '超级管理员'){ }}
          <a class="layui-btn layui-btn-disabled layui-btn-xs"><i class="layui-icon layui-icon-delete"></i>删除</a>
        {{#  } else { }}
          <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>
        {{#  } }}
      </script>
    </div>
  </div>
</div>

<script>
layui.use('auth', layui.factory('auth'));
layui.use('adminuser', layui.factory('adminuser'));


layui.use('auth', layui.factory('auth'));
layui.data.done = function(d){
  layui.use(['admin', 'form'], function(){
    var $ = layui.$
    ,form = layui.form;
    form.render(); //渲染该模板下的动态表单
  });
};
layui.data.menu = function(d){
  layui.use(['admin', 'form'], function(){
    var $ = layui.$
    ,form = layui.form;
    form.render(); //渲染该模板下的动态表单




  });
};
</script>


